#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

int averageFlowers(vector<int> petals) {
    int number = 0;
    
    vector<int> an {}; 
    
    for(int i = 0; i < petals.size(); i++){
        number = petals[i] + number;      
    }
 
    int average = number / petals.size();

    for(int n : petals){
        if(petals[n-1] == average){
            an.insert(an.end(), average);
        }
        cout<<"n = "<<n<<endl;
    }
    return an.size();
}

int main(int argc, char const *argv[])
{
    vector<int> p{10, 2, 3, 4, 5};
    int result = averageFlowers(p);
    cout<<result<<endl;
    
    return 0;
}
